<file>scalable/actions/color-pick.svg</file>
<file>scalable/actions/carousel-arrow-next-symbolic.svg</file>
<file>scalable/actions/carousel-arrow-previous-symbolic.svg</file>
+ <file>scalable/actions/dark-mode-symbolic.svg</file>
<file>scalable/actions/pointer-double-click-symbolic.svg</file>
<file>scalable/actions/pointer-drag-symbolic.svg</file>
<file>scalable/actions/pointer-primary-click-symbolic.svg</file>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" height="16px" viewBox="0 0 16 16" width="16px"><path d="m 8 0 c -4.40625 0 -8 3.59375 -8 8 s 3.59375 8 8 8 s 8 -3.59375 8 -8 s -3.59375 -8 -8 -8 z m 0 1.941406 c 3.359375 0 6.058594 2.699219 6.058594 6.058594 s -2.699219 6.058594 -6.058594 6.058594 z m 0 0" fill="#222222"/></svg>
<file>ui/status/accessibility.js</file>
<file>ui/status/autoRotate.js</file>
<file>ui/status/brightness.js</file>
+ <file>ui/status/darkMode.js</file>
<file>ui/status/dwellClick.js</file>
<file>ui/status/location.js</file>
<file>ui/status/keyboard.js</file>
this._location = new imports.ui.status.location.Indicator();
this._thunderbolt = new imports.ui.status.thunderbolt.Indicator();
this._nightLight = new imports.ui.status.nightLight.Indicator();
+ this._darkMode = new imports.ui.status.darkMode.Indicator();
this._rfkill = new imports.ui.status.rfkill.Indicator();
this._autoRotate = new imports.ui.status.autoRotate.Indicator();
this._unsafeMode = new UnsafeModeIndicator();
this._indicators.add_child(this._thunderbolt);
this._indicators.add_child(this._location);
this._indicators.add_child(this._nightLight);
+ this._indicators.add_child(this._darkMode);
if (this._bluetooth)
this._indicators.add_child(this._bluetooth);
this._indicators.add_child(this._rfkill);
if (this._bluetooth)
this._addItems(this._bluetooth.quickSettingsItems);
this._addItems(this._nightLight.quickSettingsItems);
+ this._addItems(this._darkMode.quickSettingsItems);
this._addItems(this._rfkill.quickSettingsItems);
this._addItems(this._autoRotate.quickSettingsItems);
this._addItems(this._unsafeMode.quickSettingsItems);
--- /dev/null
+/* exported Indicator */
+const {Gio, GObject} = imports.gi;
+
+const Main = imports.ui.main;
+const {QuickToggle, SystemIndicator} = imports.ui.quickSettings;
+
+const DarkModeToggle = GObject.registerClass(
+class DarkModeToggle extends QuickToggle {
+ _init() {
+ super._init({
+ label: _('Dark Mode'),
+ iconName: 'dark-mode-symbolic',
+ });
+
+ this._settings = new Gio.Settings({
+ schema_id: 'org.gnome.desktop.interface',
+ });
+ this._changedId = this._settings.connect('changed::color-scheme',
+ () => this._sync());
+
+ this.connectObject(
+ 'destroy', () => this._settings.run_dispose(),
+ 'clicked', () => this._toggleMode(),
+ this);
+ this._sync();
+ }
+
+ _toggleMode() {
+ Main.layoutManager.screenTransition.run();
+ this._settings.set_string('color-scheme',
+ this.checked ? 'default' : 'prefer-dark');
+ }
+
+ _sync() {
+ const colorScheme = this._settings.get_string('color-scheme');
+ const checked = colorScheme === 'prefer-dark';
+ if (this.checked !== checked)
+ this.set({checked});
+ }
+});
+
+var Indicator = GObject.registerClass(
+class Indicator extends SystemIndicator {
+ _init() {
+ super._init();
+
+ this.quickSettingsItems.push(new DarkModeToggle());
+ }
+});
js/ui/status/autoRotate.js
js/ui/status/bluetooth.js
js/ui/status/brightness.js
+js/ui/status/darkMode.js
js/ui/status/dwellClick.js
js/ui/status/keyboard.js
js/ui/status/location.js